<?php

基于 bootstrap-0-入口.php

'Illuminate\Foundation\Bootstrap\BootProviders' 的功能就是启动整个项目。


\vendor\laravel\framework\src\Illuminate\Foundation\Bootstrap\BootProviders.php
    namespace Illuminate\Foundation\Bootstrap;

    use Illuminate\Contracts\Foundation\Application;

    class BootProviders
    {
        /**
         * Bootstrap the given application.
         *
         * @param  \Illuminate\Contracts\Foundation\Application  $app
         * @return void
         */
        public function bootstrap(Application $app)
        {
            $app->boot();
        }
    }


\vendor\laravel\framework\src\Illuminate\Foundation\Application.php
    public function boot()
    {
        if ($this->booted) {
            return;
        }

        // Once the application has booted we will also fire some "booted" callbacks
        // for any listeners that need to do work after this initial booting gets
        // finished. This is useful when ordering the boot-up processes we run.
        $this->fireAppCallbacks($this->bootingCallbacks);

        array_walk($this->serviceProviders, function ($p) {
            $this->bootProvider($p);
        });

        $this->booted = true;

        $this->fireAppCallbacks($this->bootedCallbacks);
    }
    protected function bootProvider(ServiceProvider $provider)
    {
        if (method_exists($provider, 'boot')) {
            return $this->call([$provider, 'boot']);// 执行每个 providers 的 boot 方法；
        }
    }

